#ifndef _NE_MIDI_NOTE_TRACK_H_
#define _NE_MIDI_NOTE_TRACK_H_

#include <audio/MIDI/MIDITrack.h>

namespace ne
{
    class NEAPI MIDINoteTrack
    {
        public:
            explicit MIDINoteTrack(const std::string &name="MIDI Note Track");

            void setName(const std::string &name)
            {
                mName = name;
            }

            const std::string& getName() const
            {
                return mName;
            }

            void setChannel(const byte channel)
            {
                mChannel = channel;
            }

            byte getChannel() const
            {
                return mChannel;
            }

            void setInstrument(const byte instrument)
            {
                mInstrument = instrument;
            }

            byte getInstrument() const
            {
                return mInstrument;
            }

            size_t getNumNotes() const
            {
                return mNoteList.size();
            }

            MIDINoteListIterator begin()
            {
                return mNoteList.begin();
            }

            MIDINoteListConstIterator begin() const
            {
                return mNoteList.begin();
            }

            MIDINoteListIterator end()
            {
                return mNoteList.end();
            }

            MIDINoteListConstIterator end() const
            {
                return mNoteList.end();
            }

            bool build(MIDITrack *pTrack);

            void destroyAllNotes();

            ~MIDINoteTrack();

        private:
            std::string mName;
            byte mChannel;
            byte mInstrument;
            MIDINoteList mNoteList;
    };
}

#endif
